<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
    <title>K12试听课预约平台</title>
    <link rel="stylesheet" href="../../static/lib/fontawesome/all.min.css">
    <link rel="stylesheet" href="../../static/lib/layer/theme/default/layer.css">
    <link rel="stylesheet" href="../../static/css/main.css">
    <link rel="stylesheet" href="../../static/css/login.css">
</head>
<body>

<div id = app>
    <!-- 页头 -->
    <div class="page-header">
        <div class="top-bar">
            <a href="index.html" class="brand">
                <i class="far fa-clock yellow"></i>
                <span class="brand orange">K12试听课预约平台</span>
            </a>
        </div>
    </div>

    <!-- 页面主体 -->
    <div class="main-body">
        <form id="form1" class="user-form" action="/user/add" method="post">
            <div class="types">
                <span>用户注册</span>
            </div>
            <div class="field">
                <input type="text" name="username" placeholder="用户名">
            </div>
            <div class="field">
                <input type="password" name="password" placeholder="密码">
            </div>
            <div class="field">
                <input type="text" name="nickname" placeholder="昵称">
            </div>
            <div class="field">
                <input type="text" name="phone" placeholder="手机号码">
            </div>
            <div class="actions">
                <!--<button type="button">注册</button>-->
                <a id="zc" class="button" href="javascript:void(0)">注册</a>
            </div>
            <div class="links">
<!--                <a href="#">忘记密码？</a>-->
                <a href="/user/login">已有账户,去登录</a>
            </div>

        </form>


    </div>
    <!-- 页脚 -->
    <div class="page-foot">
        <div class="hr"></div>
        <span class="info">&copy;2019 软赢科技 版权所有</span>
    </div>
</div>

</body>
<script src="../lib/vue.min.js"></script>
<script src="../lib/axios.min.js"></script>
<script src="../lib/layer/layer.js"></script>
<script src="../js/main.js"></script>
<script src="../js/login.js"></script>
<script src="../lib/jquery.min.js"></script>

<script>
    $(function(){
        $("#zc").click(function () {
            let username = $("input[name='username']").val();
            let password = $("input[name='password']").val();
            let nickname = $("input[name='nickname']").val();
            let phone = $("input[name='phone']").val();
            if (username==""){
                alert("请设置用户名");
            }else if (password==""){
                alert("请设置密码");
            }else if (nickname==""){
                alert("请设置昵称");
            }else if (phone==""){
                alert("请设置手机号码");
            }else{
                alert("注册成功,去登录");
                $("#form1").submit();
            }

        });
    })

</script>
</html>